<template>
  <div class="deSwiper">
    <swiper :options="swiperOption" ref="mySwiper"  v-for="(list, index) of deData" :key="index" class="swiper-he">
      <!-- slides -->
      <swiper-slide v-for="(lists, index) of list.homeSwipe" :key="index" class="swiper-info">
        <img class="swiper-img" :src="lists.swipe" alt="">
      </swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  props:{
    deData: Array
  },
  data() {
    return {
      swiperOption: {
        autoplay: 3000,
        loop: true,
        pagination: '.swiper-pagination'
      },
    }
  },
  // 从父组件获取数据到子组件
  // mounted() {
  //   console.log(this.deData)
  // },
}
</script>

<style lang="less">
  .deSwiper{
    width: 100%;
    padding-top: 1.5rem;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
    background: white;
    .swiper-he{
      height: 7.6rem;
      .swiper-info{
        text-align: center;
        .swiper-img{
          height: 6.8rem;
          padding-top: .3rem;
        }
      }
      .swiper-pagination-bullet-active{
        background: #3ea7e4;
      }
    }
  }
</style>
